package com.demo.controller;

import com.demo.entity.Course;
import com.demo.mapper.CourseMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description
 * @Author huangbaozai
 * @Date 2022/11/17 9:31
 **/
@RestController
@RequestMapping("/course")
public class CourseController {
    @Resource
    private CourseMapper courseMapper;

    @GetMapping("/test")
    public String test(){
//        Course course = new Course();
//        course.setCid(799696723155877888L);
//        course.setCname("799696723155877888");
//        this.courseMapper.updateNameById(course);

//        for(int i = 1; i <= 10; ++i) {
//            Course course = new Course();
//            course.setCname("html_" + i);
//            course.setUserId(100L);
//            course.setCstatus("1");
//            this.courseMapper.insert(course);
//        }
        Course course = new Course();
        course.setCid(799696721473961985L);
        course.setCname("fffffffffff");
        courseMapper.updateById(course);

//        courseMapper.update(course, Wrappers.lambdaQuery(Course.class).eq(Course::getCid,799696723155877888L));
        return "11";
    }
}
